<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<SinBiota.Model.Entities.User>" %>
<%@ Import Namespace="Localization" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Details
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Details</h2>

    <fieldset>
        <legend><%: Strings.Fields %></legend>
        
        <div class="display-label"><%: Strings.Name %></div>
        <div class="display-field"><%: Model.Name %></div>

        <div class="display-label"><%: Strings.Username %></div>
        <div class="display-field"><%: Model.Username %></div>
        
        <div class="display-label"><%: Strings.Email %></div>
        <div class="display-field"><%: Model.Email %></div>
        
        <% if (!string.IsNullOrEmpty(Model.Comment))
        { %>	
        <div class="display-label"><%: Strings.Comment %></div>
        <div class="display-field"><%: Model.Comment %></div>
        <% } %>
        
        <div class="display-label"><%: Strings.LockedOut %></div>
        <div class="display-field"><%: Model.IsLockedOut %></div>
        
        <div class="display-label"><%: Strings.Online %></div>
        <div class="display-field"><%: Model.IsOnline %></div>
        
        <div class="display-label"><%: Strings.CreationDate %></div>
        <div class="display-field"><%: String.Format("{0:g}", Model.CreationDate) %></div>
        
        <div class="display-label"><%: Strings.LastLoginDate %></div>
        <div class="display-field"><%: String.Format("{0:g}", Model.LastLoginDate) %></div>
        
        <div class="display-label"><%: Strings.LastActivityDate %></div>
        <div class="display-field"><%: String.Format("{0:g}", Model.LastActivityDate) %></div>
        
        <div class="display-label"><%: Strings.Role%></div>
        <div class="display-field"><%: Model.Role %></div>
        
        <div class="display-label"><%: Strings.Projects%></div>
        <% if (Model.CoordinatorProjects.Count > 0)
           { %>
        <div class="display-field"><%= String.Join("<br>", Model.CoordinatorProjects.Select(x => Html.ActionLink(x.Name, "Details", "Project", new { id = x.Id }, null).ToHtmlString() + " (" + Strings.Coordinator + ")"))%></div>
        <% } %>
        <% if (Model.MemberProjects.Count > 0)
           { %>
        <div class="display-field"><%= String.Join("<br>", Model.MemberProjects.Select(x => Html.ActionLink(x.Name, "Details", "Project", new { id = x.Id }, null).ToHtmlString() + " (" + Strings.Member + ")"))%></div>
        <% } %>

    </fieldset>
    <div>
    <div class="small button radius">
        <%: Html.ActionLink(Strings.Edit, "Edit", new { id=Model.Id  }) %>
        </div>
        <div class="small button radius">
        <%: Html.ActionLink(Strings.BackToList, "Index") %>
    </div>

</asp:Content>

